package xiangMu.car;

public class Bus extends Auto {   //客车类


    public Bus() {  //无参构造方法
    }

    public Bus(String carNumber, String brand, int dayRent, int seatNumber, boolean state, int record) {
        super(carNumber, brand, dayRent, seatNumber, state, record);
    }

    @Override
    public double calcRent(int days) {
        double sumRent = getDayRent() * days;
        if (days >= 150) {
            sumRent *= 0.6;
        } else if (days >= 30) {
            sumRent *= 0.7;
        } else if (days >= 7) {
            sumRent *= 0.8;
        } else if (days >= 3) {
            sumRent *= 0.9;
        }
        return sumRent;
    }

    @Override
    public String toString() {
        return "客车  " + getBrand() + ",车牌：" + getCarNumber() + "," + getSeatNumber() + "座，日租金：¥" + getDayRent() + "元，";
    }
}
